﻿#region Copyright(C) 2009 NCS Pte. Ltd. All rights reserved.
// ==================================================================================================
// Copyright(C) 2006 NCS Pte. Ltd. All rights reserved.
//
// SYSTEM NAME	:   iConnect .Net Application Framework
// COMPONENT ID :   NCS.IConnect.ExceptionHandling.Wcf
// COMPONENT DESC:  
//
// CREATED DATE/BY:  22 Desc 2009 / Jiang Jin Nan
//
// REVISION HISTORY:	
// DATE/BY			SR#/CS/PM#/OTHERS		DESCRIPTION OF CHANGE
// ==================================================================================================
#endregion

using System;
using System.ServiceModel;
using System.ServiceModel.Activation;

namespace CBEC.Core.Wcf
{
    /// <summary>
    /// The extended <see cref="ServiceHostFactory"/> to create the <see cref="ExceptionHandlingServiceHost"/>.
    /// </summary>
    public class ExceptionHandlingServiceHostFactory : ServiceHostFactory
    {
        /// <summary>
        /// Creates a <see cref="T:System.ServiceModel.ServiceHost"/> for a specified type of service with a specific base address.
        /// </summary>
        /// <param name="serviceType">Specifies the type of service to host.</param>
        /// <param name="baseAddresses">The <see cref="T:System.Array"/> of type <see cref="T:System.Uri"/> that contains the base addresses for the service hosted.</param>
        /// <returns>
        /// A <see cref="T:System.ServiceModel.ServiceHost"/> for the type of service specified with a specific base address.
        /// </returns>
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            return new ExceptionHandlingServiceHost(serviceType, baseAddresses);
        }
    }
}
